package myky.com.doctorapp.model;

import java.util.HashMap;

import io.reactivex.Observable;
import myky.com.doctorapp.api.ApiManager;
import myky.com.doctorapp.contract.FeedBackContract;
import myky.com.doctorapp.entity.FeedBackEntity;
import myky.com.doctorapp.utils.RequestBodyBuilder;

public class FeedBackModel implements FeedBackContract.Model {
    @Override
    public Observable<FeedBackEntity> upFeedContent(String customerId, String userName, String phoneModel, String osVersion, String os, String content, String phone, String picture) {

        RequestBodyBuilder.Builder builder = new RequestBodyBuilder.Builder();


        builder
                .params("customerId", customerId)
                .params("userName", userName)
                .params("phoneModel", phoneModel)
                .params("osVersion", osVersion)
                .params("os", os)
                .params("content", content)
                .params("phone", phone);
        if (picture != null) {
            builder.params("picture", picture);

        }
        HashMap<String, String> map = builder.getMap();
        return ApiManager.getApistore().upFeedContent(map);
    }
}
